package com.offcn.dao;

import com.offcn.entity.User;

public class UserDao extends BaseDao<User> {
    //根据用户名和密码查询用户信息
    public User login(String username,String password){
        String sql = "select * from user where username=? and pwd=?";
        return queryOne(sql,User.class,username,password);
    }
    //添加用户信息
    public Boolean register(User u){
        String sql = "insert into user(username,pwd,name,tel,bir) values(?,?,?,?,?)";
        Object[] param = {u.getUsername(),u.getPwd(),u.getName(),u.getTel(),u.getBir()};
        return update(sql,param)>0 ? true : false;
    }
}
